﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) CompanyName.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	#region Using Statements
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	using MbUnit.Framework;

	using Describe = MbUnit.Framework.TestsOnAttribute;
	using InContext = MbUnit.Framework.DescriptionAttribute;
	using It = MbUnit.Framework.TestAttribute;
	using Should = MbUnit.Framework.DescriptionAttribute;
	using By = MbUnit.Framework.AuthorAttribute;
	using Tag = MbUnit.Framework.CategoryAttribute;
	#endregion

	[
		Describe(typeof(FavoriteClient)),
		InContext("should perform its specified behavor."),
		Tag("Functional"),
		Ignore,
		By("Michael Herndon", "mherndon@opensourceconnections.com", "www.amptools.net")
	]
	public class FavoriteClientSpec : Spec
	{

		[It, Should(" create a favorite, get a list of favorites and destroy a favorite. ")]
		public void CreateListAndDestroy()
		{
			StatusClient statusClient = Twitter.CreateStatusClient();

			FavoriteClient client = Twitter.CreateFavoriteClient();

			Status[] tweets = statusClient.GetUserTimeline(AssemblyFixture.Username, new TimelineOptions() { Count = 1 });
			tweets.Length.ShouldBe(1);
			
			Status tweet = tweets[0];
			
			Status fav = client.Create(tweet.Id.Value);
			fav.ShouldNotBeNull();
			fav.Id.Value.ShouldBeGreaterThan(0);

			tweets = client.GetList(AssemblyFixture.Username);
			tweets.ShouldNotBeNull();
			tweets.Length.ShouldBeGreaterThan(0);

			client.Destroy(fav.Id.Value);

		}
	}
}
